public class Main {
    public static void get(int x){
        //7  0111
        System.out.println(x);
        int n = x;
        System.out.print("奇数位：");
        for(int i = 31; i >= 0; i -= 2){
            System.out.print(((n >>> i) & 1) + " ");
        }
        System.out.println();
        System.out.print("偶数位：");
        for (int i = 30; i >= 0; i -= 2){
            System.out.print(((n >>> i) & 1) + " ");
        }
        System.out.println();
    }
    public static void main(String[] args) {
        //获取一个数二进制序列中所有的偶数位和奇数位， 分别输出二进制序列
        get(7);
        get(8);
        get(9);
        get(10);
    }
}